#ifndef TABLE_COLUMN_H
#define TABLE_COLUMN_H 1

#include <stdarg.h>

#include <common/macro/build.h>
#include <common/io.h>
#include <common/datatype.h>

typedef struct column_t {
	char *name;
	datatype_t *datatype;

	int dt_args_raw_c;
	char **dt_args_raw;

	void *dt_args;
} column_t;

API_PUBLIC column_t *column_new_list(char *, const char *, char **, int);
API_PUBLIC column_t *column_new(char *, const char *, ...);
API_PUBLIC void column_destroy(column_t *);
API_LIBLOCAL void column_compile_args(column_t *);
API_LIBLOCAL int column_serialize_file(column_t *, iohandle_t);
API_LIBLOCAL column_t *column_deserialize_file(iohandle_t);
API_LIBLOCAL ssize_t column_serialize(column_t *, char *, ssize_t);
API_LIBLOCAL ssize_t column_deserialize(column_t **, const char *, ssize_t);

#endif
